<?php
include 'header.html';
include 'SqlHelper.php';
include 'desplegar.php';
$sqlhelper = new SqlHelper();
$set = $sqlhelper->generarNuevoExpediente();
$fila = mysql_fetch_array($set);
$numeroExpediente = $fila['MAX(Expediente)']+1;
?>
<link href="text.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="validarEntrada.js"> </script>
	<p align="center" class="text">Menu</p>
	</div>
	<br>
		<?php
			$results = $sqlhelper->getExpedientePorNombreYFN($_POST["nombre"], $_POST["fechaNacimiento"]);
			echo "<table border='1'>";
			echo "<tr> <th>Exp#</th><th>Entrada</th><th>Nombre</th>
	  <th>Lugar Nac.</th> <th>Fecha Nac.</th> <th>Escolaridad</th> 
	  <th>Domicilio</th> <th>Ciudad</th> <th>Telefono</th>
	  <th>Diagnostico</th> <th>Tratamiento</th><th>Antecedentes</th>
	  <th>Apoyos</th> <th>Motivo Visita</th> <th>Foto</th> </tr>";
	  // keeps getting the next row until there are no more to get
	  while($row = mysql_fetch_array( $results )) {
		// Print out the contents of each row into a table
		echo "<tr><td>"; 
		echo $row['Expediente'];
		echo "</td><td>";
		echo $row['FechaEntrevista'];
		echo "</td><td>";
		echo $row['NombreCompleto'];
		echo "</td><td>";
		echo $row['LugarNacimiento'];
		echo "</td><td>";
		echo $row['FechaNacimiento'];
		echo "</td><td>";
		echo $row['Escolaridad'];
		echo "</td><td>";
		echo $row['Domicilio'];
		echo "</td><td>";
		echo $row['Ciudad'];
		echo "</td><td>";
		echo $row['Telefono'];
		echo "</td><td>";
		echo $row['DiagnosticoMedico'];
		echo "</td><td>";
		echo $row['Tratamiento'];
		echo "</td><td>";
		echo $row['Antecedentes'];
		echo "</td><td>";
		echo $row['ApoyadoPor'];
		echo "</td><td>";
		echo $row['RazonDeVisita'];
		echo "</td><td>";
		echo $row['NombreFoto'];
		echo "</td></tr>"; 
	  } 
	  echo "</table>";
	 
	 
	 echo "<br/>";
	 echo "<br/>";
		?>
<?php
include 'footer.html';
?>
